<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title></title>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link rel="stylesheet" type="text/css" href="../resources/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../resources/css/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="../resources/css/grumble.css">

    <script type="text/javascript" src="../resources/scripts/jquery-1.11.1.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/bootstrap-datetimepicker.zh-CN.js"></script>
    <script type="text/javascript" src="../resources/scripts/jquery.grumble.min.js"></script>
    <script type="text/javascript" src="../resources/scripts/zhBase.js"></script>
    <script type="text/javascript" src="../resources/scripts/zhForm.js"></script>
    <script>
        $(function () {

            /**
             * 提交后的响应函数
             * @param data 服务器返回
             */
            function deal(data) {
                alert(data.msg);
            }

            var zf = new zhForm($("#formId"));
            $("#btnid").click(function () {
                var isSuccess = zf.verify();
                if (isSuccess) {
                    zf.submitForm(deal);
                }
            });
        });
    </script>
</head>
<BODY class="mian_bg">
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
    <TR height=28>
        <TD class="addr_td">&nbsp;&nbsp;<img src="/sys/resources/images/addr_icon.png">&nbsp;当前位置: 自建考试>新增考试</TD>
    </TR>
    <TR>
        <TD bgColor=#7ca600 height=1></TD>
    </TR>
    <TR>
        <TD bgColor=#8ebe00 height=1></TD>
    </TR>
</TABLE>

<div class="container">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">新增考试</h3>
        </div>
        <div class="panel-body">
            <form action="/sys/exam/editData.do" id="formId" class="form-horizontal" role="form">
                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="name" class="col-sm-3 control-label">考试名称</label>

                            <div class="col-sm-9">
                                <input name="id" type="hidden" value="${exam.id}">

                                <input name="name" type="text" notNull="true" class="form-control" id="name"
                                      value="${exam.name}" placeholder="考试名称">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="testtime" class="col-sm-3 control-label">考试时间(分钟)</label>

                            <div class="col-sm-9">
                                <input name="testtime" type="text" isNumber="true" class="form-control" id="testtime"
                                       value="${exam.testtime}"  placeholder="考试时间">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="score" class="col-sm-3 control-label">满分分数</label>

                            <div class="col-sm-9">
                                <input name="score" type="text" isNumber="true" class="form-control" id="score"
                                       value="${exam.score}"  placeholder="满分分数">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label for="testnum" class="col-sm-3 control-label">题目数量</label>

                            <div class="col-sm-9">
                                <input name="testnum" type="text" isNumber="true" class="form-control" id="testnum"
                                       value="${exam.testnum}" placeholder="题目数量">
                            </div>
                        </div>
                    </div>
                </div>

                <div class="row">
                    <div class="col-xs-2">
                    </div>
                    <div class="col-xs-4">
                        <button type="button" id="btnid" class="btn btn-success btn-block">提交</button>
                    </div>
                    <div class="col-xs-2">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>
